// 获取url后参数
function getRequest(url: any = location.search): any {
  // const url = location.search
  url = url.split('?');
  console.log(url, '999');
  if (url.length === 0 || (url.length === 1 && url[0] === '')) {
    return {};
  }
  url = '?' + url[1];
  const theRequest = new Object();
  if (url.indexOf('?') !== -1) {
    const str = url.substr(1);
    const strs = str.split('&');
    for (const item of strs) {
      theRequest[item.split('=')[0]] = item.split('=')[1];
    }
  }
  return theRequest;
}

export default getRequest;
